package com.kly.user.controller;

import com.fqgj.common.api.Response;
import com.kly.user.dto.UserAccountDto;
import com.kly.user.dto.UserBaseDto;
import com.kly.user.dto.UserChangeDto;
import com.kly.user.dto.UserInfoDto;
import com.kly.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * chatter-model 关系类
 */
@RestController
@RequestMapping("/chatter")
public class ChatterModelController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping(value = "/")
    public Response<UserInfoDto> initUserInfo(@Valid @RequestBody UserChangeDto userChange, BindingResult results,
                                              @RequestParam String userCode) {
        if (results.hasErrors()) {
            System.out.println("出现问题：" + results.getFieldErrors().get(0));
            return Response.error();
        }

        return Response.ok();
    }

}
